import store from "../../store";
// import {connect} from "react-redux"
// 认识状态
// dispatch：更改状态
// subscribe：订阅状态更改
function HelloStore() {
    // 注册状态改变
    store.subscribe(() => {
        console.log(store.getState());
    })
    return (
        <div>
            <h2>Hello react redux</h2>
            <button onClick={() => store.dispatch({ type: 'INCREMENT' })}>+</button>
            <button onClick={() => store.dispatch({ type: 'DECREMENT' })}>-</button>
        </div>
    )

}

export default HelloStore